ifMatches

fun <T> ifMatches(block: () -> Promise<T>, shouldRetry: (message: String?) -> Boolean, retries: Int = 3, delayMillis: Double): Promise<T>

Retries block with a fixed delay, but only while shouldRetry (given the error's message) returns true.